package Controller;

import entity.Student;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.ArrayList;
import java.util.List;

@Controller

public class IndexController {
    @GetMapping("/index")
    public String index(Model model){

        Student student = new Student();
        student.setId(11451);
        student.setName("豪尔");
        student.setSex(1);
        List<String> hobby = new ArrayList<>();
        hobby.add("sleep");
        hobby.add("play");
        hobby.add("football");
        student.setHobby(hobby);



        model.addAttribute("student",student);
        model.addAttribute("hello","你好");
        return "index";
    }

}
